package com.ea.eadp.nexus.test.pageDefinition.newconsole;

import org.openqa.selenium.WebDriver;
import org.testng.Assert;

/**
 * Created by yimingcao on 11/21/2014.
 */
public class UpdateEmailPage extends ConsoleBasePage {
    public static final String updateButton = "continueBtn";

    public UpdateEmailPage(WebDriver driver) {
        super(driver, UpdateEmailPage.class, updateButton);
    }

    public void assertThisIsThePage() {
        Assert.assertEquals(this.getElementStringByXPath("//span[@class='title']"), "Update Your Email");
    }

    public void enterNewEmailAddress(String newEmailAddress) {
        this.sendInput("newEmail", newEmailAddress);
    }

    public void clickUpdateButton() throws InterruptedException {
        clickBlank("//div[@id='panel-email-update']//span[@class='title']");
        Thread.sleep(2000);
        sendControllerKey('A');
    }

    public void skipThisPage() {
        sendControllerKey('B');
    }
}
